﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DeepTalkRenderServiceLib
{
    /// <summary>
    /// keeps a single task going trying to render meetings as they go - never giving up... EVER.
    /// </summary>
    public class RenderMeetings
    {
        /// <summary>
        /// Start the main task to render a meeting.
        /// </summary>
        public static Task Start(RenderMeetingTask.RenderCallbackFunctionType callback, string wcfDTRenderContractName)
        {
            var result = RenderMeetingTask.Start(callback, wcfDTRenderContractName);
            result.ContinueWith(oldt =>
                {
                    Start(callback, wcfDTRenderContractName);
                });
            return result;
        }
    }
}
